Skip to main content
Version: 1.0.4

Agent API

Agent service API Documentation kadal bot

Version: 1.0.4

HOME SCREEN OF CREATE BOT

kadal botimg

Paths

Health check API -

/aiwb/bot/api/v1/healthz

  • Method: GET
  • Summary: Health
  • Description: Return Health Status. :return:
  • Responses:
    • 200:
      • Description: Successful Response
      • Content-Type: application/json

List Chat Bots API

/aiwb/bot/api/v1/

  • Method: GET

  • Summary: List Chat Bots

  • Description: The List Chat Bots API provides functionality to retrieve a list of available chat bots. This API allows users to obtain information about multiple chat bots, such as their names, descriptions, versions, and other relevant metadata.

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/"

# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

params={
"page_no":1,
"page_size":10,
"filter":"String",
"is_published":"True/False",
"order":"asc/desc"
}
response = requests.get(URL, headers=headers,params=params)
print(response)

Example Response value -

{
"status_code": "200",
"total_bot_count": 2,
"chat_bots": [
{
"chat_bot_id": "d781c0f9-3b95-45b4-8de5-dede1521c4dd",
"chatbotName": "George Washington",
"creation_time": "2023-12-18T03:29:39",
"chatbotDescription": "This Bot is Capable of addressing queries about George Washington",
"modelId": "Anthropic"
},
{
"chat_bot_id": "2d1e5624-46d6-49f6-bf7c-fa6f16c0f693",
"chatbotName": "Summarization",
"creation_time": "2023-12-18T17:35:56",
"chatbotDescription": "This Bot is Capable of Summarizing the Texts",
"modelId": "1"
}
]
}

Responses:

Status CodeDescriptionContent-Type
200Bots Listed Successfullyapplication/json
400Bad Requestapplication/json
404Resource Not Foundapplication/json
500Internal Server Errorapplication/json
422Validation Errorapplication/json

Create Chat Bot API

/aiwb/bot/api/v1/

  • Method: POST

  • Summary: Create Chat Bot

  • Description: This API empowers users to design and configure a chat bot according to specific requirements.

Request Payload:

TypeParameterDescriptionData Typeis_optional
Parameterchatbot_global_idID of the chat botstring (UUID)mandatory
Query ParameterchatbotNameThe name of the chat botstringmandatory
Query ParameterchatbotDescriptionThe description of the chat botstringoptional
Query Parameterfolder_idsList of folder IDs associated with the chat botarray of stringsoptional
Query Parameterobject_idsList of object IDs associated with the chat botarray of stringsoptional
Query ParametermodelIdModel ID for the chat bot (OpenAI, Palm)stringmandatory
Query ParametermodelVersionModel version for GPT (e.g., "gpt-35-turbo", "gpt-4") or for Palm (e.g., "chat-bison@001")stringoptional
Query ParametercontextContext for chat generationstringoptional
Query ParametertemperatureControls the level of randomness or 'creativity' in the generated textnumber (float)optional
Query Parametermax_tokensMaximum length that the model is allowed to generateintegeroptional
Query Parametertop_pManages the randomness of the output textnumber (float)optional
Query Parametertop_kSignifies sampling from k most likely next tokens at each stepintegeroptional
Query Parameterfrequency_penaltyEnsures that the model does not repeat the same words or phrases too frequentlynumber (float)optional
Query Parameterpresence_penaltyEnsures that the model includes a diverse range of tokens in the output textnumber (float)optional
Query Parameterbest_ofNumber of completions to generate and return the best oneintegeroptional
Query Parameterguard_railList of guard rail conditionsarrayoptional
Query ParameterexamplesList of example prompts for the chatbotarrayoptional

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/"

# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

params={
"chatbotName": "string",
"chatbotDescription": "string",
"folder_ids": [],
"object_ids": [],
"modelId": "string",
"modelVersion": "string",
"context": "string",
"temperature": 2,
"max_tokens": 1,
"top_p": 1,
"top_k": 1,
"frequency_penalty": 2,
"presence_penalty": 2,
"best_of": 1,
"guard_rail": [],
"examples": []
}
response = requests.post(URL, headers=headers,params=params)
print(response)

Example Response value -

{
"status_code": 201,
"message": "string",
"chat_bot_id": "string"
}

Responses:

Status CodeDescriptionContent-Type
200Successful Responseapplication/json
201Bot Created Successfullyapplication/json
400Bad Requestapplication/json
409Conflict - Bot Already Presentapplication/json
500Internal Server Errorapplication/json
422Validation Errorapplication/json

Get Chat Bot By Id API

/aiwb/bot/api/v1/{chatbot_global_id}

  • Method: GET
  • Summary: Get Chat Bot By Id
  • Description: This API allows users to fetch a specific chat bot using its unique ID (chatbot_global_id). It is useful for retrieving detailed information about a particular chat bot.

Request Payload:

TypeParameterDescriptionData Typeis_optional
Parameterchatbot_global_idID of the chat botstring (UUID)mandatory

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

params={
"chatbot_global_id":"string"
}
response = requests.get(URL, headers=headers,params=params)
print(response)

Example Response value -

{
"status_code": 200,
"message_id": 1,
"message": "Hello"
}

Responses:

Status CodeDescriptionContent-Type
200Bot Getapplication/json
400Bad Requestapplication/json
403Forbiddenapplication/json
404Resource Not Foundapplication/json
500Internal Server Errorapplication/json
422Validation Errorapplication/json

Update Chat Bot By Id API

/aiwb/bot/api/v1/{chatbot_global_id}

  • Method: PUT
  • Summary: Update Chat Bot By Id
  • Description: This API enables users to modify and enhance an existing chat bot.

Request Payload:

TypeParameterDescriptionData Typeis_optional
Parameterchatbot_global_idID of the chat botstring (UUID)mandatory
Query ParameterchatbotNameThe name of the chat botstringmandatory
Query ParameterchatbotDescriptionThe description of the chat botstringoptional
Query Parameterfolder_idsList of folder IDs associated with the chat botarray of stringsoptional
Query Parameterobject_idsList of object IDs associated with the chat botarray of stringsoptional
Query ParametermodelIdModel ID for the chat bot (OpenAI, Palm)stringmandatory
Query ParametermodelVersionModel version for GPT (e.g., "gpt-35-turbo", "gpt-4") or for Palm (e.g., "chat-bison@001")stringoptional
Query ParametercontextContext for chat generationstringoptional
Query ParametertemperatureControls the level of randomness or 'creativity' in the generated textnumber (float)optional
Query Parametermax_tokensMaximum length that the model is allowed to generateintegeroptional
Query Parametertop_pManages the randomness of the output textnumber (float)optional
Query Parametertop_kSignifies sampling from k most likely next tokens at each stepintegeroptional
Query Parameterfrequency_penaltyEnsures that the model does not repeat the same words or phrases too frequentlynumber (float)optional
Query Parameterpresence_penaltyEnsures that the model includes a diverse range of tokens in the output textnumber (float)optional
Query Parameterbest_ofNumber of completions to generate and return the best oneintegeroptional
Query Parameterguard_railList of guard rail conditionsarrayoptional
Query ParameterexamplesList of example prompts for the chatbotarrayoptional

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

params={
"chatbot_global_id":"string"
}
response = requests.put(URL, headers=headers,params=params)
print(response)

Example Response value -

{
"status_code": "200",
"message": "Bot Update : Bot Updated Successfully"
}

Responses:

Status CodeDescriptionContent-Type
200Bot Updated Successfullyapplication/json
400Bad Requestapplication/json
403Forbiddenapplication/json
404Resource Not Foundapplication/json
409Conflictapplication/json
500Internal Server Errorapplication/json
422Validation Errorapplication/json

Delete Chat Bot By Id API

/aiwb/bot/api/v1/{chatbot_global_id}

  • Method: DELETE
  • Summary: Delete Chat Bot By Id
  • Description: This API allows you to permanently remove a chat bot.

Request Payload:

TypeParameterDescriptionData Typeis_optional
Parameterchatbot_global_idID of the chat botstring (UUID)mandatory

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

params={
"chatbot_global_id":"string"
}
response = requests.delete(URL, headers=headers,params=params)
print(response)

Example Response value -

{
"status_code": "200",
"message": "Successfully deleted Chat Sessions and all it's associated data such as Guard Rails, Examples, User Query & bot Response !!"
}

Responses:

Status CodeDescriptionContent-Type
200Bot Deleted Successfullyapplication/json
400Bad Requestapplication/json
403Forbiddenapplication/json
422Validation Errorapplication/json

Publish Chat Bot API

/aiwb/bot/api/v1/publish/{chatbot_global_id}

  • Method: POST
  • Summary: Publish Chat Bot
  • Description: This API publishes a chat bot using the specified chatbot_global_id.

Parameters:

  • chatbot_global_id: UUID

Request Payload:

TypeParameterDescriptionData Typeis_optional
Parameterchatbot_global_idID of the chat botstring (UUID)mandatory

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/publish/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

params={
"chatbot_global_id":"string"
}
response = requests.post(URL, headers=headers,params=params)
print(response)

Example Response value -

{
"status_code": 200,
"message": "Bot has been published successfully."
}

Responses:

Status CodeDescriptionContent-Type
200Successful Responseapplication/json
422Validation Errorapplication/json

Get Embed Credentials API

/aiwb/bot/api/v1/embed/get_credentials/{chatbot_global_id}

  • Method: GET
  • Summary: Get Embed Credentials
  • Description: Get Embed Credentials for a specified chat bot.

Request Payload:

TypeParameterDescriptionData Typeis_optional
Parameterchatbot_global_idID of the chat botstring (UUID)mandatory

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/embed/get_credentials/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

params={
"chatbot_global_id":"string"
}
response = requests.get(URL, headers=headers,params=params)
print(response)

Example Response value -

{
"status_code": 200,
"message": "Successfully fetched embedding parameters for chatbot Bot123.",
"data": {
"token_url": "https://api-xyz.co/auth/api/v1/oauth/connect/token",
"refresh_url": "https://api-xyz.co/auth/api/v1/oauth/connect/refresh",
"chat_url": "https://api-xyz.co/aiwb/chat/api/v2/994548a0-c910-4fa0-b2e2-58ea7dbd3abc?ext_user_id_ref=<user_id of bot user>",
"client_id": "58842435-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"client_secret": "090458109309240AB420480a01a1eb7f7af761afa290"
}
}

Responses:

Status CodeDescriptionContent-Type
200Successfully fetchedapplication/json
400Bot unavailableapplication/json
401Unauthorizedapplication/json
500Internal Server Errorapplication/json
422Validation Errorapplication/json

Generate Embed Credentials API

/aiwb/bot/api/v1/embed/generate_credentials/{chatbot_global_id}

  • Method: POST
  • Summary: Generate Embed Credentials
  • Description: Generate Embed Credentials for a specified chat bot.

Request Payload:

TypeParameterDescriptionData Typeis_optional
Parameterchatbot_global_idID of the chat botstring (UUID)mandatory
query_ParametertargetTarget application for which the credentials are generated. Default is empty string. Maximum length is 100 characters and minimum length is 3 charactersstring (UUID)mandatory
query_Parameteraccess_token_lifespanAccess token lifespan in seconds. Default is 3600 seconds and maximum is 7200 secondsstring (UUID)mandatory

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/embed/generate_credentials/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

params={
"chatbot_global_id":"string"
}
response = requests.post(URL, headers=headers,params=params)
print(response)

Example Response value -

{
"status_code": 200,
"message": "Successfully generated client credentials for chatbot Bot123.",
"data": {
"client_id": "53a81240-xxxx-xxxx-xxxxxxxxxxxx",
"client_secret": "599a7b7d1969623B6631F81D11a90a0909241204482A",
"target": "KadalTest"
}
}

Responses:

Status CodeDescriptionContent-Type
200Successfully fetchedapplication/json
400Bot unavailable or target not supportedapplication/json
401Unauthorizedapplication/json
500Internal Server Errorapplication/json
422Validation Errorapplication/json

Get Models Details API

/aiwb/bot/api/v1/models/

  • Method: GET
  • Summary: Get Models Details
  • Description: Pulls the model details with all required parameters needed to define a bot.

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/models/"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

response = requests.get(URL, headers=headers)
print(response)

Example Response value -

{
"platform": {
"OpenAI": {
"model_type": {
"Chat": {
"Temperature": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Controls the level of randomness or 'creativity' in the generated text with higher temperature settings generating more creative and less predictable texts and vice versa"
},
"Max Tokens": {
"min": 1,
"max": 4000,
"step": 1,
"default": 256,
"description": "Maximum length that model is allowed to generate"
},
"Top-p": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Manages the randomness of the output text by establishing a probability threshold and then selecting tokens for predicting the next words"
},
"Frequency Penalty": {
"min": 0,
"max": 2,
"step": 0.1,
"default": 0.5,
"description": "Ensures that the model does not repeat the same words or phrases too frequently within the output text"
},
"Presence Penalty": {
"min": 0,
"max": 2,
"step": 0.1,
"default": 0.5,
"description": "Ensures that the model includes a diverse range of tokens in the output text"
}
},
"Text": {
"Temperature": {
"min": 0,
"max": 2,
"step": 0.1,
"default": 0.5,
"description": "Controls the level of randomness or 'creativity' in the generated text with higher temperature settings generating more creative and less predictable texts and vice versa"
},
"Max Tokens": {
"min": 1,
"max": 4000,
"step": 1,
"default": 256,
"description": "Maximum length that model is allowed to generate"
},
"Top-p": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Manages the randomness of the output text by establishing a probability threshold and then selecting tokens for predicting the next words"
},
"Frequency Penalty": {
"min": 0,
"max": 2,
"step": 0.1,
"default": 0.5,
"description": "Ensures that the model does not repeat the same words or phrases too frequently within the output text"
},
"Presence Penalty": {
"min": 0,
"max": 2,
"step": 0.1,
"default": 0.5,
"description": "Ensures that the model includes a diverse range of tokens in the output text"
},
"Best Of": {
"min": 1,
"max": 20,
"step": 1,
"default": 10,
"description": "Generates best_of completions server-side and returns the “best”"
}
}
},
"model_versions": [
"gpt-35-turbo",
"gpt-4"
]
},
"Palm": {
"model_type": {
"Chat": {
"Temperature": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Controls the level of randomness or 'creativity' in the generated text with higher temperature settings generating more creative and less predictable texts and vice versa"
},
"Max Tokens": {
"min": 1,
"max": 1024,
"step": 1,
"default": 256,
"description": "Maximum length that model is allowed to generate"
},
"Top-p": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Manages the randomness of the output text by establishing a probability threshold and then selecting tokens for predicting the next words"
},
"Top-k": {
"min": 1,
"max": 40,
"step": 1,
"default": 20,
"description": "Signifies sampling from k most likely next tokens at each step"
}
},
"Text": {
"Temperature": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Controls the level of randomness or 'creativity' in the generated text with higher temperature settings generating more creative and less predictable texts and vice versa"
},
"Max Tokens": {
"min": 1,
"max": 1024,
"step": 1,
"default": 256,
"description": "Maximum length that model is allowed to generate"
},
"Top-p": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Manages the randomness of the output text by establishing a probability threshold and then selecting tokens for predicting the next words"
},
"Top-k": {
"min": 1,
"max": 40,
"step": 1,
"default": 20,
"description": "Signifies sampling from k most likely next tokens at each step"
}
}
},
"model_versions": [
"chat-bison@001",
"chat-bison@002",
"text-bison",
"gemini-pro"
]
}
}
}

Responses:

Status CodeDescriptionContent-Type
200Successful Responseapplication/json

Get Target API

/aiwb/bot/api/v1/targets/

  • Method: GET

  • Summary: Get Target

  • Description: Get Targets.

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/targets/
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

response = requests.get(URL, headers=headers)
print(response)

Example Response value -

{
"status_code": 200,
"message": "Successfully fetched supported targets.",
"data": [
{
"1": "Application1",
"2": "Application2",
"3": "Application3"
}
]
}

Responses:

Status CodeDescriptionContent-Type
200Successful Responseapplication/json

Create Target API

  • Method: POST
  • Summary: Delete Target
  • Description: Delete a Target with the specified target_id.

Request Payload:

TypeParameterDescriptionData Typeis_optional
query_parametertarget_idName of the targetstringMandatory

Sample code

import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/targets/
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }

response = requests.post(URL, headers=headers)
print(response)

Example Response value -

{
"status_code": 200,
"message": "Successfully deleted target."
}

Responses:

Status CodeDescriptionContent-Type
200Successful Responseapplication/json
422Validation Errorapplication/json

Components

Schemas

BotGenerateCredentials

  • Type: object
  • Description: Schema for generating bot credentials.
  • Properties:
    • target:
      • Type: string
      • Description: Target application for which the credentials are generated. (3-100 characters)
    • access_token_lifespan:
      • Type: integer
      • Description: Access token lifespan in seconds. (Default: 3600, Max: 7200)

Chat Bot Create schema and details

  • Type: object
  • Description: Schema for creating a chat bot.
  • Properties:
    • chatbotName:
      • Type: string
      • Description: Name of the chat bot.
    • chatbotDescription:
      • Type: string
      • Description: Description of the chat bot.
    • folder_ids:
      • Type: array
      • Description: List of folder IDs associated with the chat bot.
    • object_ids:
      • Type: array
      • Description: List of object IDs associated with the chat bot.
    • modelId:
      • Type: string
      • Description: Model ID for the chat bot (OpenAI, Palm).
    • modelVersion:
      • Type: string
      • Description: Version of the model used.
    • context:
      • Type: string
      • Description: Context of the chat bot.
    • temperature:
      • Type: number
      • Description: Level of creativity in the generated text.
    • max_tokens:
      • Type: integer
      • Description: Maximum length of generated text.
    • top_p:
      • Type: number
      • Description: Probability threshold for token selection.
    • top_k:
      • Type: number
      • Description: Sampling from k most likely next tokens.
    • frequency_penalty:
      • Type: number
      • Description: Avoiding repetition in output text.
    • presence_penalty:
      • Type: number
      • Description: Ensuring diversity in output text.
    • best_of:
      • Type: integer
      • Description: Number of best outputs to return.
    • guard_rail:
      • Type: array
      • Description: Guard rail settings for the chat bot.
    • examples:
      • Type: array
      • Description: Examples for the chat bot.

Create Target schema and details

  • Type: object
  • Description: Schema for creating a target application.
  • Properties:
    • target_name:
      • Type: string
      • Description: Name of the target application. (3-100 characters)

Example

  • Type: object
  • Description: Example schema.
  • Properties:
    • question:
      • Type: string
    • answer:
      • Type: string

HTTPValidationError

  • Type: object
  • Description: Validation error schema.
  • Properties:
    • detail:
      • Type: array

Msg

  • Type: object
  • Description: Message schema.
  • Properties:
    • msg:
      • Type: string

Order

  • Type: string
  • Description: An enumeration.

ResponseBotCommon

  • Type: object
  • Description: Common response schema.
  • Properties:
    • status_code:
      • Type: integer
    • message:
      • Type: string

ResponseBotCreate

  • Type: object
  • Description: Response schema for chat bot creation.
  • Properties:
    • status_code:
      • Type: integer
    • message:
      • Type: string
    • chat_bot_id:
      • Type: string

ResponseBotGet

  • Type: object
  • Description: Response schema for fetching chat bot details.
  • Properties:
    • status_code:
      • Type: integer
    • chat_bot_id:
      • Type: string
    • data:

ResponseBotList

  • Type: object
  • Description: Response schema for listing chat bots.
  • Properties:
    • status_code:
      • Type: integer
    • message:
      • Type: string
    • total_bot_count:
      • Type: integer
    • chat_bots:

ValidationError

  • Type: object
  • Description: Validation error schema.
  • Properties:
    • loc:
      • Type: array
    • msg:
      • Type: string
    • type:
      • Type: string